/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.manager.search;

import br.com.foxline.model.Quality;
import br.com.foxline.service.QualityService;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author roniere
 */
@ManagedBean
@ViewScoped
public class ManagerSearchQuality implements Serializable {

    @EJB
    QualityService qualityService;
    private Quality quality;
    private List<Quality> qualitys;

    @PostConstruct
    public void init() {
        quality = new Quality();
        qualitys = new ArrayList<Quality>();
    }

    public List<Quality> getQualitys() {
        return qualitys;
    }

    public void setQualitys(List<Quality> qualitys) {
        this.qualitys = qualitys;
    }

    
    public Quality getQuality() {
        return quality;
    }

    public void setQuality(Quality quality) {
        this.quality = quality;
    }
    
    public void searchQuality(){
        System.err.println(quality);
        this.qualitys = qualityService.findQuality(quality);
    }
}
